gboolean antialias)
{
CGContextRef cg_context;
+ CGSize scale;
if (GDK_WINDOW_DESTROYED (window_impl->wrapper))
return NULL;
CGContextSaveGState (cg_context);
CGContextSetAllowsAntialiasing (cg_context, antialias);
+ /* Undo the default scaling transform, since we apply our own
+ * in gdk_quartz_ref_cairo_surface () */
+ scale = CGContextConvertSizeToDeviceSpace (cg_context,
+ CGSizeMake (1.0, 1.0));
+ CGContextScaleCTM (cg_context, 1.0 / scale.width, 1.0 / scale.height);
+
return cg_context;
}
if (!impl->cairo_surface)
{
+ gint scale = gdk_window_get_scale_factor (impl->wrapper);
+
impl->cairo_surface =
gdk_quartz_create_cairo_surface (impl,
- gdk_window_get_width (impl->wrapper),
- gdk_window_get_height (impl->wrapper));
+ gdk_window_get_width (impl->wrapper) * scale,
+ gdk_window_get_height (impl->wrapper) * scale);
+
+ cairo_surface_set_device_scale (impl->cairo_surface, scale, scale);
}
else
cairo_surface_reference (impl->cairo_surface);